﻿using UnityEngine;

public class ButterflyCollision
{
    private string colliderName;

    public ButterflyCollision(string _colliderName)
    {
        colliderName = _colliderName;
    }

    public bool hasCollidedWith(Collider collider)
    {
        return isObjectCollided(colliderName, collider);
    }

    private bool isObjectCollided(string objectName, Collider collider)
    {
        return collider.gameObject.name.Contains(objectName);
    }
}
